package com.web.test.listener;

import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

/**
 * Created by St01 on 2017-9-25.
 */
public class MySessionListener implements HttpSessionListener {



    @Override
    public void sessionCreated(HttpSessionEvent httpSessionEvent) {
        System.out.println("session init =====");

        HttpSession session = httpSessionEvent.getSession();

        System.out.println(session.getId());
        System.out.println(session.getAttribute("id")+"=====id==========");

    }

    @Override
    public void sessionDestroyed(HttpSessionEvent httpSessionEvent) {
        System.out.println("session destroy =====");
    }
}
